-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add assets source filenames #125
Conversation
65e6859
to
0223bca
Compare
Adding the following template tag ``` {% webpack_asset 'path/to/original/file' %} ``` Fixes django-webpack#343 Depends on django-webpack/webpack-bundle-tracker#125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, but please check suggested improvement.
0223bca
to
4816591
Compare
@fjsj Thanks for the review |
Adding the following template tag ``` {% webpack_asset 'path/to/original/file' %} ``` Fixes django-webpack#343 Depends on django-webpack/webpack-bundle-tracker#125
Adding the following template tag ``` {% webpack_asset 'path/to/original/file' %} ``` Fixes django-webpack#343 Depends on django-webpack/webpack-bundle-tracker#125
Adding the following template tag ``` {% webpack_asset 'path/to/original/file' %} ``` Fixes #343 Depends on django-webpack/webpack-bundle-tracker#125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check comment.
Some tests are breaking @batistadasilva |
@fjsj It seems like there is a broken test in |
The last build from 3 months ago did pass: https://github.com/django-webpack/webpack-bundle-tracker/actions/runs/7466611716 |
I am seeing the same errors when running in localhost on the commit How can I help? |
The error is this:
Please check if this is simply a hash change. If so, you can safely change the test assertion. |
Yes it was |
@batistadasilva I think now it breaks in Webpack 4? I think it's safe to ignore sourceFilename in Webpack 4. Whoever needs to use this should upgrade, as it's not a critical feature. |
@fjsj It seems like a typing error, but I don't know how to handle it Could you help me wit this? |
If if (stats.compilation.assetsInfo) {
fileInfo.sourceFilename = stats.compilation.assetsInfo.get(assetName).sourceFilename;
} |
689c4da
to
3b0306f
Compare
@fjsj Done However, the typing errors may still remain |
@batistadasilva I see that's a tsc error, but we can ignore it on Webpack 4. Please enable me to edit this PR: Or look for a way to ignore the error TS2339 in those two lines. |
Asset resources in `webpack-stats.json` file will look like, ```json "assets": { "assets/test-bbf3c94e2a3948c98900.txt": { "name": "assets/test-bbf3c94e2a3948c98900.txt", "path": "/home/user/project-root/assets/test-bbf3c94e2a3948c98900.txt", "publicPath": "http://localhost:3000/assets/test-bbf3c94e2a3948c98900.txt", "sourceFilename": "src/test.txt" } } ``` Related to django-webpack/django-webpack-loader#343
3b0306f
to
3ffd7ce
Compare
It would be with pleasure, but I couldn't find the checkbox the documentation is talking about
I don't think we can ignore a specific TS rule, so I ignored TS in both lines. |
Thanks! We will release soon. |
Add
sourceFilename
fieldAsset resources in
webpack-stats.json
file will look like,Related to django-webpack/django-webpack-loader#343